/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package actions;

import com.opensymphony.xwork2.ActionContext;
import com.paris5.master2.guitarmaster.bean.EcomUser;
import com.paris5.master2.guitarmaster.service.ServiceProductRemote;

/**
 *
 * @author Alice
 */
public class PostComment extends EcomAction {

    private String comment_area;
    private int idProductType;
    private String productTitle;
    private String productDescription;

    public String getProductTitle() {
        return productTitle;
    }

    public void setProductTitle(String productTitle) {
        this.productTitle = productTitle;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public String getComment_area() {
        return comment_area;
    }

    public void setComment_area(String comment_area) {
        this.comment_area = comment_area;
    }

    public int getIdProductType() {
        return idProductType;
    }

    public void setIdProductType(int idProductType) {
        this.idProductType = idProductType;
    }

    @Override
    public String execute() {
        EcomUser ecomUser = (EcomUser) getFromSession("USER");
        ServiceProductRemote serviceProductRemote = lookupServiceProductRemote();
        /*System.out.println("AAAAAAAAAAAAAAAAAAAA_" + ecomUser.getId() + " " + idProductType + " " + comment_area);*/
        serviceProductRemote.setComment(ecomUser.getId(), idProductType, comment_area);
        setMessage("Votre avis a bien été posté.");
        return SUCCESS;
    }
}
